import java.util.Arrays;

public class TestDemo1 {
    public static void main(String[] args){
        double[] arr = {1,2.3,2.4};
//        for(int i = 0; i < arr.length; ++i){
//            System.out.println(arr[i]);
//        }
//
          for(double x : arr) {//增强for循环
              System.out.println(x + " ");
          }
        System.out.println(Arrays.toString(arr));

    }

}
